<template>
  <el-form ref="form" size="mini" label-width="120px" :model="v" :rules="rules">
    <el-form-item label="社工/访谈人：" prop="a">
      <el-input v-model="v.a"></el-input>
    </el-form-item>
    <el-form-item label="被访谈人：" prop="b">
      <el-input v-model="v.b"></el-input>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  name: "thItem",
  props: {
    value: {
      type: Object,
      default() {
        return {
          a: '',
          b: '',
        }
      }
    }
  },
  data() {
    return {
      rules: {
        a: [
          { required: true, message: '请输入社工/访谈人内容', trigger: 'blur' },
        ],
        b: [
          { required: true, message: '请输入被访谈人内容', trigger: 'blur' },
        ],
      }
    }
  },
  computed: {
    v: {
      get() {
        return this.value
      },
      set(newV) {
        this.$emit('update:value', newV)
      },

    }
  }
}
</script>

<style scoped>

</style>
